//
//  RCSBaseViewController.h
//  RCS
//
//  Created by wFeng on 14-8-11.
//  Copyright (c) 2014年 Chinasofti. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ASPublicDefine.h"
#import "ASAppDelegate.h"
#import "SVProgressHUD.h"
#import "UIView+RCSToast.h"



//#import "IRcSCallbackObserverCenter.h"
#define KTabBarImageName @"tabBarImageName"
typedef enum KNaviItemIndex:NSInteger{
    KLeftButtonItem = 0,
    KMidButtonItem = 1,
    KRightButtonItem = 2,
} KNaviItemIndex;

typedef void(^RCSBaseTitleButtonBlock)();

#define BUTTONMarginX    10
#define BUTTONMarginUP   0
#define NAVBUTTON_WIDTH  44
#define NAVBUTTON_HEIGHT 44

#define NAVBUTTONTEXT_WIDTH 80



@interface ASBaseViewController : UIViewController

@property (nonatomic, strong) UIButton*	leftButton;
@property (nonatomic, strong) UIButton*	rightButton;
@property (nonatomic, strong) UIButton*	callButton;
//@property (nonatomic, strong) NSString*	sUserId;
@property (nonatomic, assign) CGRect	naviFrame;
@property (nonatomic, copy)   NSString* strNavTitle;
@property (nonatomic, assign) BOOL		isTransparent;  /**< 导航设置透明*/


/**
 *	@brief	设置导航左边的button的图片名和背景图片名
 *
 *	@param 	imageName 	button的图片名
 *	@param 	bgImageName 	button的背景图片名
 */
- (void)setLeftButtonWithImageName:(NSString *)imageName bgImageName:(NSString *)bgImageName;
- (void)setRightButtonWithImageName:(NSString *)imageName bgImageName:(NSString  *)bgImageName;
- (void)setRightButtonWithImageName:(NSString *)imageName pressedImageName:(NSString *)pressedImageName;

- (void)setRightCallButtonWithImageName:(NSString *)callImageName
				   callPressedImageName:(NSString *)callPressedImageName
				   rightButtonImageName:(NSString *)rightImageName
				  rightPressedImageName:(NSString *)rightPressedImageName;

- (void)setLeftButtonWithHide:(BOOL)hide;
- (void)setRightButtonWithHide:(BOOL)hide;

- (void)setLeftButtonWithImageName:(NSString*)imageName
					   bgImageName:(NSString*)bgImageName
				tipButtonImageName:(NSString*)tipImageName
				  tipBackImageName:(NSString*)tipBackImageName;

/**
 *  设置右边item按钮
 *
 *  @param title                 标题
 *  @param normalTitleColor      标题默认颜色
 *  @param highlightedTitleColor 标题高亮
 *  @param disabledTitleColor    标题不可用颜色
 *  @param bgImageName           背景颜色
 */
- (void)setRightButton:(NSString *)title
      normalTitleColor:(UIColor *)normalTitleColor
      highlightedTitleColor:(UIColor *)highlightedTitleColor
      disabledTitleColor:(UIColor *)disabledTitleColor
           bgImageName:(NSString *)bgImageName;


- (void)createLeftAndRightMenuItem:(UIView *(^)(KNaviItemIndex nIndex))menuItem;
- (void)createLeftAndRightMenuItem:(UIView *(^)())leftItem
							right:(UIView *(^)())rightItem;

- (void)createTitleButtonWithCount:(NSInteger)buttonCount
					   titleArray:(NSArray *)titleArray
						   action:(void (^)(KNaviItemIndex nIndex))action;

- (void)setRightText:(NSString *)text;
- (void)setRightTextBlackList:(NSString *)text;

- (void)setLeftText:(NSString *)text;
- (void)setStrNavTitle:(NSString *)navTitle;
- (void)setNavTitleColor:(UIColor *)titleColor;
- (void)setNavTitleName:(NSString *)name number:(NSInteger)number;

- (void)reloadSkinImage;
- (void)leftButtonPressed:(id)action;
- (void)rightButtonPressed:(id)action;

/**
 *	@brief	拨打界面按钮
 *
 *	@param 	action
 *
 *	@return	N/A
 */
- (void)callButtonPressed:(id)action;

- (void)addObserver;
- (void)removeObserver;
- (BOOL)canDragBack; //是否支持左滑返回
/**
 *  截图函数
 *
 *  @param view
 *
 *  @return 
 */
- (NSString *)getImagePathFromMapView:(UIView *)view imageName:(NSString *)imageName;
- (NSString *)getTabBarImagePath;
- (NSString *)tabBarCaptureImage;

//将vc移除栈
- (void)removeControllerFromStack:(Class)c;

//判断网络连接状态
- (BOOL)showAlwer;

- (void)handleUIApplicationWillChangeStatusBarFrameNotification:(NSNotification*)notification;

@end


